﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace auxiliary_proj
{
    public partial class FormShowMessage : Form
    {
        FormComposeMessage fcm;
        string Sender;
        static string sub;

        //Default Constructor
        public FormShowMessage()
        {
            InitializeComponent();
        }

        //Parameterized constructor
        public FormShowMessage(string from, string subject, string date, string message, string sender)
        {
            InitializeComponent();
            this.From.Text = from;
            this.Subject.Text = subject;
            sub = subject;
            this.Date.Text = date;
            this.rtbMessageInbox.Rtf = message;
            this.Sender = sender;
        }

        //Creates a new form to compose a message once the reply button is clicked 
        private void btnReply_Click(object sender, EventArgs e)
        {
            fcm = new FormComposeMessage(Sender);
            fcm.StartPosition = FormStartPosition.CenterScreen;
            fcm.Show();
            this.Close();
        }

        public string getSubject(){
            return sub;
        }
    }
}
